﻿using JX.Core;
using JX.Core.Entity;
using JX.Infrastructure.Common;
using JX.Infrastructure.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;

namespace JX.Application
{
	/// <summary>
	/// 数据库表：Stock 的应用层服务接口实现类.
	/// </summary>
	public partial class StockServiceAppDapper : ServiceAppDapper<StockEntity>,IStockServiceAppDapper
	{
		private readonly IStockRepositoryDapper m_repository;
		/// <summary>
		/// 构造器注入
		/// </summary>
		public StockServiceAppDapper(IStockRepositoryDapper repository) : base(repository)
		{
			m_repository = repository;
		}
		
		#region 删除
		/// <summary>
		/// 通过主键删除
		/// </summary>
		/// <returns></returns>
		public virtual bool Delete(int? stockID)
		{
			return m_repository.Delete(stockID );
		}
		/// <summary>
		/// 通过主键删除
		/// </summary>
		/// <returns></returns>
		public virtual async Task<bool> DeleteAsync(int? stockID)
		{
			return await m_repository.DeleteAsync(stockID );
		}
		#endregion
		
		#region 得到实体
		/// <summary>
		/// 通过主键返回第一条信息的实体类。
		/// </summary>
		/// <returns></returns>
		public virtual StockEntity Get(int? stockID)
		{
			return m_repository.Get(stockID );
		}
		/// <summary>
		/// 通过主键返回第一条信息的实体类。
		/// </summary>
		/// <returns></returns>
		public virtual async Task<StockEntity> GetAsync(int? stockID)
		{
			return await m_repository.GetAsync(stockID );
		}
		#endregion
	}
}